<?php $this->headTitle('Allocation History');  ?>
<?php $this->headScript()->appendFile('js/jquery/tab.js'); ?>

<div class="box">
  <div class="left"></div>
  <div class="right"></div>
  <div class="heading">
    <h1 style="background-image: url('images/setting.png');">Allocation History</h1>
    <div class="buttons">
        <a onclick="location = '<?php echo $this->backUrl; ?>';" class="button"><span><< Back</span></a>
    </div>
    </div>
  <div class="content">
  <div style="display: inline-block; width: 100%;">
  <div class="vtabs">
      <a tab="#tab_allocation">Allocation Information</a>
      <a tab="#tab_product">Products</a>
  </div>

      <div id="tab_allocation" class="vtabs_page">
        <table class="form">
          <tr>
            <td>Allocation ID:</td>
            <td><?php echo $this->allocation->allocationId; ?></td>
          </tr>
          <tr>
            <td>Allocated By:</td>
            <td><?php echo $this->escape(strtoupper($this->allocation->allocatedBy)); ?></td>
          </tr>
          <tr>
            <td>Date Allocated:</td>
            <td><?php echo date("d-M-Y", strtotime($this->allocation->dateAllocated)); ?></td>
          </tr>
        </table>
      </div>

        <div id="tab_product" class="vtabs_page">
        <table id="products" class="list">
          <thead>
            <tr>
              <td class="left">Product</td>
              <td class="right">Quantity Allocated</td>
              <td class="right">To Branch</td>
            </tr>
          </thead>

            <?php foreach($this->products as $product): ?>
                  <tbody>
                  <tr>
	          <td class="left"><a target="_blank" href="<?php echo $this->url(array('do'=>'update','id'=>$product->productId),'catalogProduct',true); ?>"><?php echo $this->escape($product->name); ?></a></td>
                  <td class="right"><?php echo $product->quantity; ?></td>
	          <td class="right"><?php echo $this->escape($product->branch); ?></td>
	          </tr>
	          </tbody>
            
          <?php endforeach; ?>
        </table>
      </div>

      </div>

</div>
</div>

<script type="text/javascript"><!--
$.tabs('.vtabs a');
//--></script>